How to call two functions simultaneously on click on a button